package com.fansm;

import java.util.Comparator;
import java.util.stream.Stream;

public class StreamDemo {

    public static void main(String[] args) {
        String[] arr = {"bo_le","","webflux","redis","spring","mvc","spring"};
        Stream.of(arr)
                // 数据过滤
                .filter(e -> !e.isEmpty())
                // 数据去重
                .distinct()
                .filter("bo_le"::equals)
                // 数据转换
                .map(e -> e.replace("_", ""))
                // 转换成一个新的流
                .flatMap(e -> Stream.of(e.split("")))
                // 数据转换
                .map(String::toUpperCase)
                // 排序
                .sorted(Comparator.reverseOrder())
                .forEach(System.out::println);
    }
}
